#pragma once
#include "instance.h"

namespace RenderSystem
{
	class Material;

	class MaterialInstance :
		public Instance
	{
	public:

		typedef MaterialParams				DynamicMaterialParameters;
		typedef MaterialParamsIterator		DynamicMaterialParametersIterator;

		MaterialInstance( const String& rInstanceId, Material* pResMaterial );
		virtual ~MaterialInstance(void);

		void SetParameter( const String& strPara, float fValue );
		void SetParameter( const String& strPara, const Common::Vector2& vValue );
		void SetParameter( const String& strPara, const Common::Vector3& vValue );
		void SetParameter( const String& strPara, const Common::Vector4& vValue );

		void SetTexture( const String& strPara, const String& strTexture );

		virtual Material* GetMaterial( void ) const;

	private:

		//used to record parameter for single object
		DynamicMaterialParameters			m_dynamicMaterialParameters;
	};

}